﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MetroFramework.Forms;

namespace ComForm.Auxiliary
{
    public partial class FormForbiddenTip : MetroForm
    {
        private int _reviveSeconds = 120;

        private bool _bAlwaysForbiden = false;

        public FormForbiddenTip()
        {
            InitializeComponent();
            this.AcceptButton = buttonOK;
            this.ControlBox = false;
        }

        public FormForbiddenTip(int n)
        {
            _reviveSeconds = n;
            InitializeComponent();
            this.AcceptButton = buttonOK;
            this.ControlBox = false;
        }

        public FormForbiddenTip(bool bAlwaysForbiden)
        {
            _bAlwaysForbiden = bAlwaysForbiden;
            InitializeComponent();
            this.AcceptButton = buttonOK;
            this.ControlBox = false;
        }

        public void SetRestTime(int n)
        {
            _reviveSeconds = n;
        }

        private void FormForbiddenTip_Load(object sender, EventArgs e)
        {
            if (_bAlwaysForbiden)
            {
                label11.Visible = true;
                labelTime.Visible = false;
                label3.Visible = false;
                label11.Top = label1.Top;
            }
            else
            {
                label11.Visible = false;
                labelTime.Visible = true;
                label3.Visible = true;
                labelTime.Text = _reviveSeconds.ToString();
            }
           
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
